feat(webhookcerts): add --enable-webhook-cert-reconciler flag - #8541
feat(webhookcerts): add --enable-webhook-cert-reconciler flag#8541patjlm wants to merge 1 commit into
Conversation
Add a new --enable-webhook-cert-reconciler flag (default true) to the hypershift operator, hypershift install, and hypershift install render commands. When set to false, the WebhookCertReconciler skips self-managed certificate generation and instead reads the CA bundle from the serving cert secret's ca.crt key (as populated by an external certificate manager such as cert-manager). The reconciler continues to patch CRDs and webhook configurations with the CA bundle in both modes. This allows deployments using cert-manager to manage webhook TLS certificates without triggering an infinite reconciliation loop between cert-manager and the built-in WebhookCertReconciler. Ref: GCP-709 Signed-off-by: Patrick Martin <patmarti@redhat.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: patjlm The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR introduces a new 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8541 +/- ##
==========================================
+ Coverage 40.10% 40.11% +0.01%
==========================================
Files 753 753
Lines 92985 93018 +33
==========================================
+ Hits 37288 37313 +25
- Misses 53001 53009 +8
Partials 2696 2696
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Summary
--enable-webhook-cert-reconcilerflag (defaulttrue) tohypershift-operator run,hypershift install, andhypershift install renderfalse, theWebhookCertReconcilerswitches to caBundle-only mode: reads the CA from the serving cert secret'sca.crtkey instead of self-managing certificatesContext
The
WebhookCertReconciler(introduced in #8174) self-manages thewebhook-serving-caandmanager-serving-certsecrets. In deployments using cert-manager to manage the webhook serving certificate (e.g. to solve the chicken-and-egg problem where the operator needs the secret mounted before it can start), the two controllers fight over the same secret, causing an infinite reconciliation loop (~120+ reissuances in minutes).This flag allows disabling the cert generation while preserving the caBundle patching that CRDs and webhook configurations need.
Ref: GCP-709
Changes
hypershift-operator/controllers/webhookcerts/webhookcerts_controller.goReconcileintoreconcileCerts(full mode) andreadCABundleFromServingCert(caBundle-only mode) gated byManageCertsfieldhypershift-operator/main.goEnableWebhookCertReconcilertoStartOptions, register--enable-webhook-cert-reconcilerflag, wire toManageCertscmd/install/install.gocmd/install/assets/hypershift_operator.goHyperShiftOperatorDeployment, emit--enable-webhook-cert-reconciler=falsein rendered args*_test.goTest plan
TestReconciletests pass (no regression withManageCerts: true)TestReconcileCABundleOnlytests: CA patching from serving cert, missing secret error, missing ca.crt error, no CA secret creationTestAddWebhookResourcesupdated: flag rendered in args when disabled, not rendered when enabledmanager-serving-cert— verify no reconciliation loop🤖 Generated with Claude Code
Summary by CodeRabbit
--enable-webhook-cert-reconcilerinstallation flag to control webhook certificate management behavior (default: enabled).